/********************************************************************************
 * MailManagerAction.java
 *
 * Created by Jigar Mistry
 * Last modified Date: Aug 29, 2008 9:15:08 AM by Jigar Mistry
 * Version : 0.1
 * Copyright (c) 2008 - 2009 cyberThink Infotech Pvt. Ltd., All rights reserved.
 ********************************************************************************/

package com.printeverywhere.action;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Enumeration;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionContext;
import com.printeverywhere.delegator.AdminServiceDelegator;
import com.printeverywhere.delegator.CommonFunctionDelegator;
import com.printeverywhere.delegator.LetterServiceDelegator;
import com.printeverywhere.delegator.MailGroupServiceDelegator;
import com.printeverywhere.delegator.MailServerDelegator;
import com.printeverywhere.delegator.UserServiceDelegator;
import com.printeverywhere.dto.GroupUser;
import com.printeverywhere.dto.Groups;
import com.printeverywhere.dto.GroupuserId;
import com.printeverywhere.dto.Letters;
import com.printeverywhere.dto.MailServer;
import com.printeverywhere.dto.MailStatus;
import com.printeverywhere.dto.MailingSystem;
import com.printeverywhere.dto.User;
import com.printeverywhere.util.AdminConstants;
import com.printeverywhere.util.CommonUtil;
import com.printeverywhere.util.DateUtil;
import com.printeverywhere.util.MailHelper;
import com.printeverywhere.util.Validator;

/**
 * The Class MailManagerAction.
 */
public class MailManagerAction extends AdminEngineManagement implements ServletRequestAware {

	/** Logger for this class. */
	private static final Logger logger = Logger
			.getLogger(MailManagerAction.class);

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The action. */
	private String action;

	/** The subject. */
	private String subject;

	/** The letter. */
	private Letters letter;

	private String submit;

	private String sendMail;

	MailStatus status;

	private List<MailStatus> mailRecord = new ArrayList<MailStatus>();

	/** The letters. */
	private List<Letters> letters = LetterServiceDelegator.getList();

	/** The group list. */
	private List<Groups> groupList;

	private List<User> addSubscriberUserList;

	private List<GroupUser> groupUserList;

	/** The groupId. */
	private String groupId;

	/** The letterId. */
	private String letterId;

	private HttpServletRequest request;

	private String deleteGroupEmail = null;

	private MailServer mailContent = new MailServer();

	private boolean createdMail;

	private String[] strArr;

	private String emailList;

	private Letters sendLetter;

	private int successCount = 0;

	private int failCount = 0;

	private Double sentTime;

	private Groups registeredGroupList;

	private String registeredGroupName;

	/** The groups. */
	private String groups[];

	public String[] getGroups() {
		return groups;
	}

	public void setGroups(String[] groups) {
		this.groups = groups;
	}

	public MailServer getMailContent() {
		return mailContent;
	}

	public void setMailContent(MailServer mailContent) {
		this.mailContent = mailContent;
	}



	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public List<User> getAddSubscriberUserList() {
		return addSubscriberUserList;
	}

	public void setAddSubscriberUserList(List<User> addSubscriberUserList) {
		this.addSubscriberUserList = addSubscriberUserList;
	}

	public List<Groups> getGroupList() {
		return groupList;
	}

	public void setGroupList(List<Groups> groupList) {
		this.groupList = groupList;
	}

	/**
	 * Gets the letter.
	 *
	 * @return the letter
	 */
	public Letters getLetter() {
		return letter;
	}

	/**
	 * Sets the letter.
	 *
	 * @param letter
	 *            the new letter
	 */
	public void setLetter(Letters letter) {
		this.letter = letter;
	}

	/**
	 * Gets the action.
	 *
	 * @return the action
	 */
	public String getAction() {
		return action;
	}

	/**
	 * Sets the action.
	 *
	 * @param action
	 *            the new action
	 */
	public void setAction(String action) {
		this.action = action;
	}

	/**
	 * Gets the letter information.
	 *
	 * @return the letter information
	 *
	 * @throws Exception
	 *             the exception
	 */
	public String getLetterInformation() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("getLetterInformation() - start"); //$NON-NLS-1$
		}

		prep();
		if (letter != null && letter.getLetterId() != 0) {
			if (action.equals("Delete_Letter")) {
				deleteLetter();

				if (logger.isDebugEnabled()) {
					logger.debug("getLetterInformation() - end"); //$NON-NLS-1$
				}
				letters = LetterServiceDelegator.getList();
				addActionMessage("Letter has been deleted Successfully");
				return "deleted";
			} else {
				letter = LetterServiceDelegator.getLetter(letter.getLetterId());
			}
		}

		if (logger.isDebugEnabled()) {
			logger.debug("getLetterInformation() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Insert or update.
	 *
	 * @return the string
	 */
	public String insertOrUpdate() {
		if (logger.isDebugEnabled()) {
			logger.debug("insertOrUpdate() - start"); //$NON-NLS-1$
		}

		if (!letterValidationSuccessful()) {
			if (logger.isDebugEnabled()) {
				logger.debug("insertOrUpdate() - end"); //$NON-NLS-1$
			}
			return INPUT;
		} else {
			if (letter.getLetterId() == 0) {
				List<Letters> lettersList = LetterServiceDelegator
						.getLettersBySubject(letter.getSubject());

				if (lettersList != null) {
					addActionError("Letters With this Subject Name is already Exist Please try another ");
					return INPUT;
				}

				letter.setAdmin(AdminServiceDelegator.getAdminByName("admin"));
				LetterServiceDelegator.insertLetter(letter);
				addActionMessage("Letter added Successfully ");
				letter.setSubject("");
				letter.setMessage("");
				letter.setLetterId(0);
				letters = LetterServiceDelegator.getList();
			} else {
				letter.setAdmin(AdminServiceDelegator.getAdminByName("admin"));
				LetterServiceDelegator.updateLetter(letter);
				addActionMessage("Letter Updated Successfully ");
			}
		}

		if (logger.isDebugEnabled()) {
			logger.debug("insertOrUpdate() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Delete letter.
	 *
	 * @return the string
	 */
	public void deleteLetter() {
		if (logger.isDebugEnabled()) {
			logger.debug("deleteLetter() - start"); //$NON-NLS-1$
		}

		LetterServiceDelegator.deleteLetter(LetterServiceDelegator
				.getLetter(letter.getLetterId()));
		letter = null;

		if (logger.isDebugEnabled()) {
			logger.debug("deleteLetter() - end"); //$NON-NLS-1$
		}
	}

	/**
	 * Validation successful.
	 *
	 * @return true, if successful
	 */
	private boolean letterValidationSuccessful() {
		if (logger.isDebugEnabled()) {
			logger.debug("letterValidationSuccessful() - start"); //$NON-NLS-1$
		}

		if (letter.getSubject() == null
				|| letter.getSubject().trim().length() < 1) {
			addActionError("Subject is required");
			return false;
		}
		if (letter.getSubject().trim().length() > 50) {
			addActionError("Subject name is too long Please try another");
			return false;
		}
		if (letter.getMessage() == null
				|| letter.getMessage().trim().length() < 1) {
			addActionError("Message is required");
			return false;
		}

			return true;
	}

	/**
	 * Prep.
	 */
	@SuppressWarnings("unchecked")
	private void prep() {
		if (logger.isDebugEnabled()) {
			logger.debug("prep() - start"); //$NON-NLS-1$
		}

		letters = LetterServiceDelegator.getList();
		Map<String, Object> session = ActionContext.getContext().getSession();
		session.put("letters", letters);

		if (logger.isDebugEnabled()) {
			logger.debug("prep() - end"); //$NON-NLS-1$
		}
	}

	/**
	 * Gets the letters.
	 *
	 * @return the letters
	 */
	public List<Letters> getLetters() {
		return letters;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	public String execute() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("execute() - start"); //$NON-NLS-1$
		}

		if (logger.isDebugEnabled()) {
			logger.debug("execute() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	public String showUserMailingList() throws Exception{

		if (logger.isDebugEnabled()) {
			logger.debug("showUserMailingList() - start"); //$NON-NLS-1$
		}

		registeredGroupList = MailGroupServiceDelegator.getGroupByStatus(true);

		if (logger.isDebugEnabled()) {
			logger.debug("showUserMailingList() - end"); //$NON-NLS-1$
		}

		return SUCCESS;
	}

	public String sendUserMailingList() throws Exception{

		if (logger.isDebugEnabled()) {
			logger.debug("sendUserMailingList() - start"); //$NON-NLS-1$
		}

		try{
			if(registeredGroupName.trim().equals("")){
				addActionError("Please enter Registered User Mailing List Name ");
				return INPUT;
			}
			addSubscriberUserList = UserServiceDelegator.getList();
			Groups groups = MailGroupServiceDelegator.getGroupByStatus(true);
				if(groups.getGroupId() != 0){
					groups.setTotalUser(addSubscriberUserList.size());
					groups.setName(registeredGroupName);
					MailGroupServiceDelegator.updateGroup(groups);
					for(int i=0;i<addSubscriberUserList.size();i++){
						GroupuserId groupuserId = new GroupuserId();
						groupuserId.setUser(addSubscriberUserList.get(i));
						groupuserId.setGroups(groups);
						GroupUser groupUser = new GroupUser();
						groupUser.setId(groupuserId);
							MailGroupServiceDelegator.insertSubscriberToGroup(groupUser);
					}
				}else{
					groups.setTotalUser(addSubscriberUserList.size());
					groups.setName(registeredGroupName);
					groups.setStatus(true);
					MailGroupServiceDelegator.insertMailGroup(groups);
					for(int i=0;i<addSubscriberUserList.size();i++){
						GroupuserId groupuserId = new GroupuserId();
						groupuserId.setUser(addSubscriberUserList.get(i));
						groupuserId.setGroups(groups);
						GroupUser groupUser = new GroupUser();
						groupUser.setId(groupuserId);
							MailGroupServiceDelegator.insertSubscriberToGroup(groupUser);
					}
				}
		}catch (Exception e) {
			addActionError("Error when creating Registered User Mailing List Name");
			e.printStackTrace();
			return INPUT;
		}

		if (logger.isDebugEnabled()) {
			logger.debug("sendUserMailingList() - end"); //$NON-NLS-1$
		}
		registeredGroupList = MailGroupServiceDelegator.getGroupByStatus(true);
		addActionMessage("successfully Created Registered User Mailing List Name");
		return SUCCESS;
	}

	/**
	 * Show manage letters.
	 *
	 * @return the string
	 *
	 * @throws Exception
	 *             the exception
	 */
	public String showManageLetters() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("showManageLetters() - start"); //$NON-NLS-1$
		}

		letters = LetterServiceDelegator.getList();

		if (logger.isDebugEnabled()) {
			logger.debug("showManageLetters() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	public void populateGroupList() throws Exception{
		groupList = MailGroupServiceDelegator.getGroupList();
		addSubscriberUserList = UserServiceDelegator.getList();

		for (Groups groups : groupList) {
			groups.setName(new StringBuffer(groups.getName()).append(" (")
					.append(
							MailGroupServiceDelegator
									.countGroupSubscriberById(groups
											.getGroupId())).append(")")
					.toString());
		}

	}

	/**
	 * Show manage mail list.
	 *
	 * @return the string
	 *
	 * @throws Exception
	 *             the exception
	 */
	public String showManageMailList() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("showManageMailList() - start"); //$NON-NLS-1$
		}

		populateGroupList();

		if (logger.isDebugEnabled()) {
			logger.debug("showManageMailList() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	public String getGroupListMail() throws Exception {

		if (logger.isDebugEnabled()) {
			logger.debug("getGroupListMail() - start"); //$NON-NLS-1$
		}

		populateGroupList();

		if (groupId == null) {
			addActionError("Please Select Group for Load Subscriber Email");
			return INPUT;
		} else {

			groupUserList = MailGroupServiceDelegator.getGroupUserByGroupId(Integer.parseInt(groupId));

			if (logger.isDebugEnabled()) {
				logger.debug("getGroupListMail() - end"); //$NON-NLS-1$
			}
		return SUCCESS;
		}
	}

	public String deleteEmailList() throws Exception {

		if (logger.isDebugEnabled()) {
			logger.debug("deleteEmailList() - start"); //$NON-NLS-1$
		}

		if(groupId != null && request.getParameterValues("email") != null){
			String[] selectedEmail = request.getParameterValues("email");
			for (String chkid : selectedEmail) {
				if (deleteGroupEmail == null) {
					deleteGroupEmail = chkid;
				} else {
					deleteGroupEmail = deleteGroupEmail + " , " + chkid;
				}
			}
			CommonFunctionDelegator.executeQuery("DELETE FROM GroupUser groupuser WHERE ((groupid = "
					+ groupId
					+ ") and userId IN ("
					+ deleteGroupEmail
					+ "))");
			populateGroupList();
			groupUserList = MailGroupServiceDelegator.getGroupUserByGroupId(Integer.parseInt(groupId));
			addActionMessage("User Email has been deleted from List");
		}else{
			populateGroupList();
			groupUserList = MailGroupServiceDelegator.getGroupUserByGroupId(Integer.parseInt(groupId));
			addActionError("Please Select Email for Delete from group");
			return INPUT;
		}

		if (logger.isDebugEnabled()) {
			logger.debug("deleteEmailList() - end"); //$NON-NLS-1$
		}
		return SUCCESS;

	}

	/**
	 * Show delete subscribers.
	 *
	 * @return the string
	 *
	 * @throws Exception
	 *             the exception
	 */
	public String showDeleteSubscribers() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("showDeleteSubscribers() - start"); //$NON-NLS-1$
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showDeleteSubscribers() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show create mail list.
	 *
	 * @return the string
	 *
	 * @throws Exception
	 *             the exception
	 */
	public String showCreateMailList() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("showCreateMailList() - start"); //$NON-NLS-1$
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showCreateMailList() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show delete list.
	 *
	 * @return the string
	 *
	 * @throws Exception
	 *             the exception
	 */
	public String showDeleteList() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("showDeleteList() - start"); //$NON-NLS-1$
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showDeleteList() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show send mass email.
	 *
	 * @return the string
	 *
	 * @throws Exception
	 *             the exception
	 */
	public String showSendMassEmail() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("showSendMassEmail() - start"); //$NON-NLS-1$
		}

		populateGroupList();

		if (logger.isDebugEnabled()) {
			logger.debug("showSendMassEmail() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	public String sendMassEmail() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("SendMassEmail() - start"); //$NON-NLS-1$
		}

		boolean flag = false;

		if(createdMail){
			if(emailList == null || emailList.equals("")){
				populateGroupList();
				addActionError("Please enter Email If you want to send Individual email id");
				return INPUT;
			}else{
				sendLetter = LetterServiceDelegator.getLetter(Integer.parseInt(letterId));
				strArr = emailList.split("\\n");
				long start = System.currentTimeMillis(); // start timing
				for(int i=0;i<strArr.length;i++){
					status = new MailStatus();
					try{
						User mailUser = UserServiceDelegator.getUserByEmail(strArr[i].trim());
						if(mailUser != null){
							this.mailContent.setLetters(sendLetter);
							this.mailContent.setUserByUserId(mailUser);
							this.mailContent.setBody(sendLetter.getMessage());
							this.mailContent.setSubject(sendLetter.getSubject());
//							this.mailContent.setExpiresDate(expiresDateFormat);
							this.mailContent.setFlag(false);
							this.mailContent.setIsRead(false);
							MailingSystem mailingSystem = (MailingSystem) ActionContext.getContext().getApplication().get(AdminConstants.MAILING_OPTIONS);
							MailHelper mailHelper = new MailHelper(mailingSystem.getServerAddress(), mailingSystem.getServerUsername(), mailingSystem.getServerPassword());
							if(Validator.isMailAddress(strArr[i])){
								mailHelper.sendMail(mailingSystem.getWebmasterEmailAddress(), strArr[i], sendLetter.getSubject(), sendLetter.getMessage());
								MailServerDelegator.insertMail(mailContent);
								flag = true;
								status.setEmail(strArr[i]);
								status.setStatus("OK");
								mailRecord.add(status);
								successCount++;
							}else{
								status.setEmail(strArr[i]);
								status.setStatus("Fail");
								mailRecord.add(status);
								failCount++;
							}
						}else{
							if(Validator.isMailAddress(strArr[i])){
								status.setEmail(strArr[i]);
								status.setStatus("Ok");
								MailingSystem mailingSystem = (MailingSystem) ActionContext.getContext().getApplication().get(AdminConstants.MAILING_OPTIONS);
								MailHelper mailHelper = new MailHelper(mailingSystem.getServerAddress(), mailingSystem.getServerUsername(), mailingSystem.getServerPassword());
								mailHelper.sendMail(mailingSystem.getWebmasterEmailAddress(), strArr[i], sendLetter.getSubject(), sendLetter.getMessage());
								mailRecord.add(status);
								successCount++;
							}else{
								status.setEmail(strArr[i]);
								status.setStatus("Fail");
								mailRecord.add(status);
								failCount++;
							}
						}
					}catch (Exception e) {
						status.setEmail(strArr[i]);
						status.setStatus("Fail");
						mailRecord.add(status);
						failCount++;
						e.printStackTrace();
					}
				}
				long stop = System.currentTimeMillis(); // stop timing
				sentTime = (Double)((Long)(stop-start)).doubleValue()/60000;
				populateGroupList();
				return SUCCESS;
			}
		}else{

			if(groups == null){
				populateGroupList();
				addActionError("Please Select Group for Send Letter");
				return INPUT;
			}else{
				long start = System.currentTimeMillis(); // start timing
				for (String group : groups) {
					groupUserList = MailGroupServiceDelegator.getGroupUserByGroupId(Integer.parseInt(group));

					for(int i=0;i<groupUserList.size();i++){
						status = new MailStatus();

						DateFormat myDate = new SimpleDateFormat("yyyy-MM-dd hh:ss:mm");
						Calendar cal = GregorianCalendar.getInstance();
						cal.add(Calendar.DAY_OF_MONTH, 15);
						String strDate = myDate.format(cal.getTime());
						Date expiresDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:ss:mm").parse(strDate);
						sendLetter = LetterServiceDelegator.getLetter(Integer.parseInt(letterId));
						this.mailContent.setLetters(sendLetter);
						this.mailContent.setUserByUserId(groupUserList.get(i).getId().getUser());
						this.mailContent.setBody(sendLetter.getMessage());
						this.mailContent.setSubject(sendLetter.getSubject());
						this.mailContent.setExpiresDate(expiresDateFormat);
						this.mailContent.setFlag(false);
						this.mailContent.setIsRead(false);

						try{
							MailingSystem mailingSystem = (MailingSystem) ActionContext.getContext().getApplication().get(AdminConstants.MAILING_OPTIONS);
							MailHelper mailHelper = new MailHelper(mailingSystem.getServerAddress(), mailingSystem.getServerUsername(), mailingSystem.getServerPassword());
							if(Validator.isMailAddress(groupUserList.get(i).getId().getUser().getEmail())){
								mailHelper.sendMail(mailingSystem.getWebmasterEmailAddress(), groupUserList.get(i).getId().getUser().getEmail(), sendLetter.getSubject(), sendLetter.getMessage());
								MailServerDelegator.insertMail(mailContent);
								flag = true;
								status.setEmail(groupUserList.get(i).getId().getUser().getEmail().toString());
								status.setStatus("OK");
								mailRecord.add(status);
								successCount++;
							}else{
								status.setEmail(groupUserList.get(i).getId().getUser().getEmail());
								status.setStatus("Fail");
								mailRecord.add(status);
								failCount++;
							}
						}catch (Exception e) {
							status.setEmail(groupUserList.get(i).getId().getUser().getEmail());
							status.setStatus("Fail");
							mailRecord.add(status);
							failCount++;
							e.printStackTrace();
						}
					}
				}
				long stop = System.currentTimeMillis(); // stop timing
				sentTime = (Double)((Long)(stop-start)).doubleValue()/60000;
				populateGroupList();

				if (logger.isDebugEnabled()) {
					logger.debug("SendMassEmail() - end"); //$NON-NLS-1$
				}
				addActionMessage("Letters has been send successful to selected list");
				return SUCCESS;

			}
		}

	}

	/**
	 * @return the subject
	 */
	public String getSubject() {
		return subject;
	}

	/**
	 * @param subject
	 *            the subject to set
	 */
	public void setSubject(String subject) {
		this.subject = subject;
	}

	public List<GroupUser> getGroupUserList() {
		return groupUserList;
	}

	public void setGroupUserList(List<GroupUser> groupUserList) {
		this.groupUserList = groupUserList;
	}

	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}

	/**
	 * @return the submit
	 */
	public String getSubmit() {
		return submit;
	}

	/**
	 * @param submit the submit to set
	 */
	public void setSubmit(String submit) {
		this.submit = submit;
	}

	public String getSendMail() {
		return sendMail;
	}

	public void setSendMail(String sendMail) {
		this.sendMail = sendMail;
	}

	public String getLetterId() {
		return letterId;
	}

	public void setLetterId(String letterId) {
		this.letterId = letterId;
	}

	public boolean isCreatedMail() {
		return createdMail;
	}

	public void setCreatedMail(boolean createdMail) {
		this.createdMail = createdMail;
	}

	public String[] getStrArr() {
		return strArr;
	}

	public void setStrArr(String[] strArr) {
		this.strArr = strArr;
	}

	public String getEmailList() {
		return emailList;
	}

	public void setEmailList(String emailList) {
		this.emailList = emailList;
	}

	public Letters getSendLetter() {
		return sendLetter;
	}

	public void setSendLetter(Letters sendLetter) {
		this.sendLetter = sendLetter;
	}

	public String getGroupId() {
		return groupId;
	}

	public int getSuccessCount() {
		return successCount;
	}

	public void setSuccessCount(int successCount) {
		this.successCount = successCount;
	}

	public int getFailCount() {
		return failCount;
	}

	public void setFailCount(int failCount) {
		this.failCount = failCount;
	}

	public Double getSentTime() {
		return sentTime;
	}

	public void setSentTime(Double sentTime) {
		this.sentTime = sentTime;
	}

	public List<MailStatus> getMailRecord() {
		return mailRecord;
	}

	public void setMailRecord(List<MailStatus> mailRecord) {
		this.mailRecord = mailRecord;
	}

	public MailStatus getStatus() {
		return status;
	}

	public void setStatus(MailStatus status) {
		this.status = status;
	}

	public Groups getRegisteredGroupList() {
		return registeredGroupList;
	}

	public void setRegisteredGroupList(Groups registeredGroupList) {
		this.registeredGroupList = registeredGroupList;
	}

	public String getRegisteredGroupName() {
		return registeredGroupName;
	}

	public void setRegisteredGroupName(String registeredGroupName) {
		this.registeredGroupName = registeredGroupName;
	}

}